package com.etc.zzsys.service.impl;

import java.util.List;

import com.etc.zzsys.dao.QuestionDao;
import com.etc.zzsys.dao.impl.QuestionDaoImpl;
import com.etc.zzsys.entity.Question;
import com.etc.zzsys.entity.User;
import com.etc.zzsys.service.QuestionService;
import com.etc.zzsys.util.PageData;

public class QuestionServiceimpl implements QuestionService {

	private QuestionDao qd=new QuestionDaoImpl();
	@Override
	public List<Question> getQuestions() {
		// TODO Auto-generated method stub
		return qd.getQuestions();
	}
	@Override
	public boolean addQuestion(Question q, int userId) {
		// TODO Auto-generated method stub
		return qd.addQuestion(q, userId);
	}
	@Override
	public boolean delQuestion(int qId) {
		// TODO Auto-generated method stub
		return qd.delQuestion(qId);
	}
	@Override
	public Question getQuestionById(int id) {
		// TODO Auto-generated method stub
		return qd.getQuestionById(id).get(0);
	}
	@Override
	public PageData<Question> queryQuestionByPage(int page, int pageSize, String key) {
		// TODO Auto-generated method stub
		return qd.queryQuestionByPage(page, pageSize, key);
	}
	@Override
	public List<Question> getLastQuestion(int num) {
		// TODO Auto-generated method stub
		return qd.getLastQuestion(num);
	}

}
